/*
 * @Description: 闭环检测node文件
 * @Author: Sang Hao
 * @Date: 2021-10-25 16:44:59
 * @LastEditTime: 2021-10-27 13:50:20
 * @LastEditors: Sang Hao
 */

#include <ros/ros.h>
#include "glog/logging.h"

#include "lidar_slam/global_defination/global_defination.h"
#include "lidar_slam/mapping/loop_closing/loop_closing_flow.hpp"

using namespace lidar_slam;

int main(int argc, char* argv[]) {
	google::InitGoogleLogging(argv[0]);
	FLAGS_log_dir = WORK_SPACE_PATH + "/Log";
	FLAGS_alsologtostderr = 1;

	ros::init(argc, argv, "loop_closing_node");
	ros::NodeHandle nh;

	std::shared_ptr<LoopClosingFlow> loop_closing_flow_ptr = std::make_shared<LoopClosingFlow>(nh);	

	ros::Rate rate(100);
	while (ros::ok()) {
		ros::spinOnce();

		loop_closing_flow_ptr->Run();

		rate.sleep();
	}

	return 0;
}